<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - 原生 JS</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>

    <!-- 这里不需要写 text/babel -->
    <script> 
        //创建虚拟 DOM 对象
        // let vDOM = React.createElement('标签名', '标签属性', '子元素');
        //单层结构
        // let vDOM = React.createElement('h1', {title: '我是标题', cls: 'h5211126'}, '你的运气有点差');
        //多层结构
        let vDOM = React.createElement('div', null, React.createElement('h2', null, '荣誉至于生死, 救赎之于荣誉 - 2'), React.createElement('p', null, '每个人都是月亮, 总有一个阴暗面,从来不让人看见'));
        console.log(vDOM);

        //渲染
        ReactDOM.render(vDOM, document.querySelector("#root"));
    </script>
   
</body>
</html>